﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SharingCenter.Web.Classes;
using SharingCenter.Web.Classes.Message;

namespace SharingCenter.Web.Mod.Invite
{
    public partial class Default : PageBase
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            GetContactsAndSendMail1.MailSubject = string.Format("{0}邀请您加入{1}", Profile.Personal.NickName, Resources.Website.SiteName);
            string regUrl = string.Format(@"{0}/Account/Register.aspx?ref={1}&m=$ContactEmail$", WebConsts.SITE_URL, Profile.UserId);
            Sc_MailTemplate tmp = MailOperations.GetMailTemplate("Account", "InviteTemplate");
            GetContactsAndSendMail1.FixedMailContent = tmp.MailContent
                .Replace(string.Format("{0}{1}{2}", WebConsts.MAIL_PARAM_L_DELIMETER, "NickName", WebConsts.MAIL_PARAM_R_DELIMETER), Profile.Personal.NickName)
                .Replace(string.Format("{0}{1}{2}", WebConsts.MAIL_PARAM_L_DELIMETER, "RegUrl", WebConsts.MAIL_PARAM_R_DELIMETER), regUrl);
            GetContactsAndSendMail1.VariableMailContent = "你好！";
            GetContactsAndSendMail1.UserId = Profile.UserId;
        }
    }
}
